package com.heze.xunhuan.vo;

import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 信息视图对象
 *
 * @author heze-xunhuan
 */
@Data
public class PostVO implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;
    private UserInfo userInfo;
    private CategoryInfo categoryInfo;
    private String title;
    private String content;
    private String mediaType;
    private List<String> mediaUrls;
    private LocationInfo locationInfo;
    private PriceInfo priceInfo;
    private Stats stats;
    private Boolean isLiked;
    private Boolean isCollected;
    private LocalDateTime createdAt;
    private String status;

    @Data
    public static class UserInfo implements Serializable {
        private Long id;
        private String nickname;
        private String avatar;
    }

    @Data
    public static class CategoryInfo implements Serializable {
        private Integer id;
        private String name;
        private String icon;
    }

    @Data
    public static class LocationInfo implements Serializable {
        private String address;
        private Double distance;
        private Double lat;
        private Double lng;
    }

    @Data
    public static class PriceInfo implements Serializable {
        private Double price;
        private String unit;
        private Boolean negotiable;
    }

    @Data
    public static class Stats implements Serializable {
        private Integer viewCount;
        private Integer likeCount;
        private Integer favoriteCount;
    }
}

